package pattern.strategy;

import pattern.template.AbstractApplication;

/**
 * 策略模式执行类
 *
 * @author sun.ye
 * @since 2020-07-15 16:40
 */
public class ApplicationRunner {

    private final Application application;

    public ApplicationRunner(Application application) {
        this.application = application;
    }

    public void run(){
        application.init();
        while (!application.done()){
            application.idle();
        }
        application.cleanup();
    }
}